This invention relates to a method and apparatus for controlling an electric discharge machine and, more particularly, to a method and apparatus for controlling an electric discharge machine of the type in which an electrode of a prescribed shape, held close to the surface of a workpiece, is moved into the workpiece to perform cutting and an electric discharge is produced across the electrode and the workpiece, thereby to machine the workpiece into the same shape as the electrode.
One type of electric discharge machine is the wire-cut electric discharge machine, wherein a wire electrode is moved relative to a workpiece along a commanded path, thereby to perform electric discharge machining. A second type of electric discharge machine employs an electrode which has a prescribed shape and which is held close to the surface of a workpiece, the electrode being moved into the workpiece to perform cutting as an electric discharge is produced across the electrode and the workpiece, thereby to machine the workpiece into the same shape as the electrode.
FIG. 1 is a schematic explanatory view of the latter electric discharge machine. An electrode EP serving as a punch is supported by a spindle SP, and is fed for machining (i.e., advanced) in the direction of the arrow by a servomotor, not shown. A voltage is applied by a power source PS across the electrode EP and a workpiece WK, which is to be machined into a die. Accordingly, when the electrode EP is advanced while a minute gap is maintained between the workpiece WK and the electrode EP, the workpiece WK is machined into a shape similar to that of the electrode EP. An enlarged bore of desired size can be readily machined in the workpiece WK by controlling, e.g., the energy of the machining pulses. If necessary, the machining operation is carried out while the electrode EP is being moved in eccentric fashion, whereby an enlarged bore of any desired dimensions can be machined.
In the electric discharge machine of the above type, it is necessary to retract the electrode immediately upon the generation of a short-circuit signal which is produced when the electrode EP contacts the workpiece WK. However, with the conventional servomotor control method, it is not possible to retract the electrode EP immediately, even though the direction of electrode movement is changed by the generation of the shortcircuit signal. FIG. 2 is a view of a conventional servomotor control system and is useful in explaining this point.
Referring to FIG. 2, numeral 101 denotes a paper tape in which numerical control (NC) data is punched. Numeral 102 denotes a control unit which causes a tape reader (not shown) to read in the NC command data from the paper tape 101, and which decodes the read NC data, delivering, e.g., M, S and T function commands to the machine side through a heavy current switchboard and a move command Z.sub.c to a pulse distributor 103, which is the succeeding stage. The pulse distributor 103 executes well-known pulse distribution computations on the basis of the move command Z.sub.c, and generates distributed pulses P.sub.s at a frequency corresponding to a commanded speed. Numeral 104 designates a known accelerator/decelerator circuit which generates a train of pulses P.sub.i by rectilinearly accelerating the pulse rate of the train of distributed pulses P.sub.s at the occurrence of this pulse train and by rectilinearly decelerating the same at the end thereof. Numeral 105 indicates a D.C. motor by which the electrode EP is fed for machining. A pulse coder 106 generates one feedback pulse FP each time the DC motor 105 rotates by a predetermined amount. An error calculating and storing unit 107 is constructed of, for example, a reversible counter, and stores the difference E.sub.r between the number of the input pulses P.sub.i received from the accelerator/decelerator circuit 104 and that of the feedback pulses FP. This error calculating and storing unit may be constructed, as shown in the figure, of an arithmetic circuit 107a for calculating the difference E.sub.r between the numbers of the pulses P.sub.i and FP, and an error register 107.sub.b for storing the error E.sub.r. More specifically, assuming that the DC motor 105 is rotating in the forward direction because of a command to that effect, the error calculating and storing unit 107 operates in such a manner that each time the input pulse P.sub.i is generated, it is counted up by means of the arithmetic circuit 107 a, while each time the feedback pulse FP is generated, the content is counted down, and that the difference E.sub.r between the number of input pulses and the feedback pulses is stored in the error register 107b. Numeral 108 denotes a digital-to-analog converter for generating an analog voltage proportional to the content (digital value) of the error register 107b, and numeral 109 a speed control circuit. The analog-to-digital converter 108 and speed control circuit 109 form a motor drive circuit.
When the control unit 102 produces the move command Z.sub.c, the pulse distributor 103 executes the pulse distribution computation and provides the distributed pulses P.sub.s. Upon receiving the pulses P.sub.s, the accelerator/decelerator circuit 104 accelerates and decelerates the pulse rate thereof and applies the train of command pulses P.sub.i to the error calculating and storing circuit 107. Thus, the content of the error register 107b becomes non-zero, so that the digital-to-analog converter 108 provides a voltage and the motor 105 is driven by the speed control circuit 109 so as to move the electrode EP. When the motor 105 has rotated by a predetermined amount, the feedback pulse FP is generated by the pulse coder 106 and is applied to the error calculating and storing unit 107. Thenceforth, the electrode EP is servo-controlled with the difference E.sub.r maintained at a constant value in a steady state until it is fed for machining to a desired, or target, position.
When the electrode EP is being fed for machining and comes into contact with the workpiece, a short-circuit signal SS is generated. When this occurs, a retraction control section within the control unit 102 sends the pulse distributor 103 a command for retracting the electrode EP. The pulse distributor 103 responds to the retraction command by generating retraction, or "back-up", pulses BS that cause the content of error register 107b become zero after a predetermined time. From then on the electrode EP is retracted or backed up by the retraction pulses to separate from the workpiece.
It will be appreciated from the foregoing discription of the the conventional method that, despite the generation of the short-circuit signal SS that initiates the retraction command, the electrode EP will not back up unless the pulse number left in the error register 107b is stepped down to zero by the generation of the pulses BS. In other words, retraction of the electrode EP does not start until the content of error register 107b becomes non-zero, which occurs after the passage of a predetermined time. Moreover, the electrode EP continues to advance, rather than back up, until the content of the error register 107b becomes zero. This delays the resumption of machining and prolongs machining time.